package com.sleep.psy.external_server.constants;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Description 公共常量
 * @Author admin
 * @Date 2019/5/10 13:59
 **/
public class CommonConstants {
	/**
	 * 自定义错误
	 */
	public static final String X_ERROR = "x.servlet.exception.code";
	public static final String X_ERROR_CODE = "x.servlet.exception.error";
	public static final String X_ERROR_MESSAGE = "x.servlet.exception.message";
	public static final String X_ACCESS_DENIED = "x.access.denied";

	/** 超级管理员ID */
	public static final int SUPER_ADMIN = 1;

	

	/** 父菜单标识,一级菜单的副菜单标识为0 */
	public static final String P_MB_CODE = "0";

	/** 父菜单标识,一级菜单的副菜单标识为0 */
	public static final Integer P_GROUP_ID = 0;
	
	public static final Integer DEFAULT_GROUP_LEVEL = 0;

	public static final Long CURRENT = 1L;

	public static final Long SIZE = 10L;
	
	/***支付宝支付****/
	public static final String PAY_TYPE_ALI = "1"; 
	
	/***APP微信支付****/
	public static final String PAY_TYPE_WX = "2"; 
	
	/***余额支付****/
	public static final String PAY_TYPE_BALANCE = "3"; 
	/****公众号支付****/
	public static final String PAY_TYPE_WX_IN = "4"; 
	
	/***小程序的支付****/
	public static final String PAY_TYPE_WX_APPLETS = "5";
	
	/***兑换码支付****/
	public static final String PAY_TYPE_REDEEM = "6";

	/***领取支付****/
	public static final String PAY_TYPE_RECEIVE = "7";
	
	/**
	 * 音频治疗情况
	 */
	public final static Map<String,Integer> SYMPTOM_LEVEL_MAP = new HashMap<>();  
	static {
		SYMPTOM_LEVEL_MAP.put("轻度", 1);  
		SYMPTOM_LEVEL_MAP.put("中度", 2); 
		SYMPTOM_LEVEL_MAP.put("重度", 3); 
	}
	
	/**
	 * 音频治疗  --用于获取
	 */
	public final static Map<Integer,String> AUDIO_SYMPTOMID_MAP = new HashMap<>();  
	static {
		//症状id 1:入睡困难  2:早醒  4:中途醒   5:睡眠浅   6:日间不适  7:多梦   
		AUDIO_SYMPTOMID_MAP.put(1, "入睡困难");  
		AUDIO_SYMPTOMID_MAP.put(2, "早醒"); 
		AUDIO_SYMPTOMID_MAP.put(3, "多梦 "); 
		AUDIO_SYMPTOMID_MAP.put(4, "中途醒"); 
		AUDIO_SYMPTOMID_MAP.put(5, "睡眠浅"); 
		AUDIO_SYMPTOMID_MAP.put(6, "日间不适"); 
		
		AUDIO_SYMPTOMID_MAP.put(7, "月经与失眠"); 
		
		
		AUDIO_SYMPTOMID_MAP.put(8, "亲人死亡引起的失眠问题"); 
		AUDIO_SYMPTOMID_MAP.put(9, "晚上起夜太多引起的失眠"); 
		
		AUDIO_SYMPTOMID_MAP.put(10, "白天吵架了晚上睡不着了");
		
		AUDIO_SYMPTOMID_MAP.put(11, "关于胆怯性失眠");
		AUDIO_SYMPTOMID_MAP.put(12, "广泛焦虑性失眠");
		
		AUDIO_SYMPTOMID_MAP.put(13, "（白天听）花滑双人组1号男生");
		AUDIO_SYMPTOMID_MAP.put(14, "（晚上听）花滑双人组1号男生");
		
		AUDIO_SYMPTOMID_MAP.put(15, "耳鸣");
		AUDIO_SYMPTOMID_MAP.put(16, "头痛");
		
		AUDIO_SYMPTOMID_MAP.put(99, "专业音频");
		
	}
	
	
	/**
	 * 音频治疗 类  用于获取
	 */
	public final static Map<Integer,String> AUDIO_SYMPTOMID_CLASS_MAP = new HashMap<>();  
	static {
		//症状id 1:入睡困难  2:早醒  3:多梦 4:中途醒   5:睡眠浅   6:日间不适     
		AUDIO_SYMPTOMID_CLASS_MAP.put(1, "difficultySleeping");  
		AUDIO_SYMPTOMID_CLASS_MAP.put(2, "earlyAwakening"); 
		AUDIO_SYMPTOMID_CLASS_MAP.put(3, "dreaminess"); 
		AUDIO_SYMPTOMID_CLASS_MAP.put(4, "halfwayAwakening"); 
		AUDIO_SYMPTOMID_CLASS_MAP.put(5, "shallowSleeping"); 
		AUDIO_SYMPTOMID_CLASS_MAP.put(6, "daytimeSymptoms"); 
		
		AUDIO_SYMPTOMID_CLASS_MAP.put(7, "menstruInsomnia"); 
		
		AUDIO_SYMPTOMID_CLASS_MAP.put(8, "deathOfFamily"); 
		AUDIO_SYMPTOMID_CLASS_MAP.put(9, "wakeUpNightMore");
		
		AUDIO_SYMPTOMID_CLASS_MAP.put(10, "quarrelDaytime");
		
		AUDIO_SYMPTOMID_CLASS_MAP.put(11, "timidInsomnia");
		AUDIO_SYMPTOMID_CLASS_MAP.put(12, "anxietyInsomnia");
		AUDIO_SYMPTOMID_CLASS_MAP.put(13, "figureSkatingDuoOneManDay");
		AUDIO_SYMPTOMID_CLASS_MAP.put(14, "figureSkatingDuoOneManNight");
		AUDIO_SYMPTOMID_CLASS_MAP.put(15, "erMing");
		AUDIO_SYMPTOMID_CLASS_MAP.put(16, "headache");
		
		AUDIO_SYMPTOMID_CLASS_MAP.put(99, "audioCure");
	}
	
	/**
	 * 音频治疗 类 用于获取
	 */
	public final static Map<Integer,String> AUDIO_SYMPTOMID_CLASS_MAP_U = new HashMap<>();  
	static {
		//症状id 1:入睡困难  2:早醒  4:中途醒   5:睡眠浅   6:日间不适  7:多梦   
		AUDIO_SYMPTOMID_CLASS_MAP_U.put(1,  "DifficultySleeping");  
		AUDIO_SYMPTOMID_CLASS_MAP_U.put(2,  "EarlyAwakening"); 
		AUDIO_SYMPTOMID_CLASS_MAP_U.put(3,  "Dreaminess"); 
		AUDIO_SYMPTOMID_CLASS_MAP_U.put(4,  "HalfwayAwakening"); 
		AUDIO_SYMPTOMID_CLASS_MAP_U.put(5,  "ShallowSleeping"); 
		AUDIO_SYMPTOMID_CLASS_MAP_U.put(6,  "DaytimeSymptoms"); 
		AUDIO_SYMPTOMID_CLASS_MAP_U.put(7, "MenstruInsomnia"); 
		
		AUDIO_SYMPTOMID_CLASS_MAP_U.put(8,  "DeathOfFamily"); 
		AUDIO_SYMPTOMID_CLASS_MAP_U.put(9,  "WakeUpNightMore");
		AUDIO_SYMPTOMID_CLASS_MAP_U.put(10, "QuarrelDaytime"); 
		AUDIO_SYMPTOMID_CLASS_MAP_U.put(11, "TimidInsomnia");
		AUDIO_SYMPTOMID_CLASS_MAP_U.put(12, "AnxietyInsomnia");
		AUDIO_SYMPTOMID_CLASS_MAP_U.put(13, "FigureSkatingDuoOneManDay");
		AUDIO_SYMPTOMID_CLASS_MAP_U.put(14, "FigureSkatingDuoOneManNight");
		AUDIO_SYMPTOMID_CLASS_MAP_U.put(15, "ErMing");
		AUDIO_SYMPTOMID_CLASS_MAP_U.put(16, "Headache");
		AUDIO_SYMPTOMID_CLASS_MAP_U.put(99, "AudioCure");
	}
	
	
	/**
	 * Class name 反射 特殊处理
	 */
	public final static Map<String,String> CLASS_NAME_SPECIAL = new HashMap<>();  
	static {
		CLASS_NAME_SPECIAL.put("Wmpi-school", "WmpiSchool");  
		CLASS_NAME_SPECIAL.put("Wmpi-schoolgi", "WmpiSchoolgi");
		CLASS_NAME_SPECIAL.put("Cs-upi", "CsUpi");
		CLASS_NAME_SPECIAL.put("Mss-ia", "MssIa");  
		CLASS_NAME_SPECIAL.put("Mss-at", "MssAt");  
		CLASS_NAME_SPECIAL.put("Y-bocs", "YBocs");  
		CLASS_NAME_SPECIAL.put("Y-brown", "YBrown");
		CLASS_NAME_SPECIAL.put("wpti_narcissism", "WptiNarcissism");
		CLASS_NAME_SPECIAL.put("wpti_paranoia", "WptiParanoia");
	}
	
	/**
	 * 家庭治疗
	 */
	public final static List<String> ageTypeList = Arrays.asList(
			"0-1岁",
			"1-2岁",
			"1~2岁",
			"2~3岁",
			"2-3岁",
			"3~4岁",
			"4~5岁",
			"5~6岁",
			"6~7岁",
			"6-7岁",
			"7~8岁",
			"8~9岁",
			"9~10岁",
			"10~11岁",
			"11~12岁",
			"11-12岁",
			"12~13岁",
			"13~14岁",
			"14-15岁",
			"14~15岁",
			"15~16岁",
			"16~17岁",
			"17~18岁") ;
	
	/**
	 * 获取测评列表
	 */
	public final static List<String> psyTypeList = Arrays.asList(
			"情绪",
			"睡眠",
			"性格",
			"压力",
			"学生",
			"强迫量表",
			"婚恋",
			"亲子") ;
	
	
	/**
	 * 只需要付一次的 courseMain type 
	 */
	public final static List<Integer> payOneCourseType = Arrays.asList(1,7,6) ;
			
	/**
	 * 特殊调节
	 */
	public final static Map<String,String> SPECIAL_AUDIO_LISTEN = new HashMap<>();  
	static {
		SPECIAL_AUDIO_LISTEN.put("menstruInsomnia", "TSH01");  
		SPECIAL_AUDIO_LISTEN.put("deathOfFamily", "TSH02");
		SPECIAL_AUDIO_LISTEN.put("wakeUpNightMore", "TSH03");
		SPECIAL_AUDIO_LISTEN.put("quarrelDaytime", "TSH04");
		SPECIAL_AUDIO_LISTEN.put("timidInsomnia", "TSH05");
		SPECIAL_AUDIO_LISTEN.put("anxietyInsomnia", "TSH06");
	}
	
	/**
	 * 
	 */
	public final static Map<String,String> CLASS_MAP = new HashMap<>();  
	static {
		CLASS_MAP.put( "scl90","症状自评量表(scl-90)");
		CLASS_MAP.put( "psqi","匹兹堡睡眠质量指数PSQI");
		CLASS_MAP.put( "psqiAudio","匹兹堡睡眠质量指数PSQI"); //是给专业音频调节功能使用
		CLASS_MAP.put("wiiq","失眠结构化问卷");
		CLASS_MAP.put( "wmpi","忆溯性人格发展量表");
		CLASS_MAP.put( "bprs","简明精神病评定量表(BPRS)");
		CLASS_MAP.put( "hama","汉密尔顿焦虑量表(HAMA)");
		CLASS_MAP.put( "hamd","汉密尔顿抑郁量表（HAMD）");
		CLASS_MAP.put( "bai","贝克焦虑量表(BAI)");
		CLASS_MAP.put("bdi","贝克抑郁量表(BDI)");
		CLASS_MAP.put( "mmpi","明尼苏达多相个性测验量表【399题】");
		CLASS_MAP.put( "sas","焦虑自评量表(SAS)");
		CLASS_MAP.put( "sds","抑郁自评量表(SDS)");
		CLASS_MAP.put( "wicq","广安门失眠综合问卷");
		CLASS_MAP.put( "wmpi-school","忆溯性人格发展量表（学生版）");
		CLASS_MAP.put( "wpti","人格倾向量表");
		CLASS_MAP.put( "wpti_paranoia","偏执人格倾向量表");
		CLASS_MAP.put( "wpti_narcissism","自恋人格倾向量表");
		CLASS_MAP.put( "y-bocs","强迫量表");
		CLASS_MAP.put("wpst","工作压力源测试");
		CLASS_MAP.put( "enrich","OLSON婚姻质量问卷（ENRICH）");
		CLASS_MAP.put("ffa","家庭功能评定");
		CLASS_MAP.put( "fesc","家庭教育方式综合测验");
		CLASS_MAP.put( "tabp","A型行为类型问卷（TABP）");
		CLASS_MAP.put("tpmp","气质测验");
		CLASS_MAP.put( "disc","性格内外向测试");
		CLASS_MAP.put( "mbti28","MBTI职业性格测试（28题）");
		CLASS_MAP.put( "mbti95","MBTI职业性格测试（95题）");
		CLASS_MAP.put( "pf16","卡特尔16种人格因素测验");
		CLASS_MAP.put( "cs-upi","大学生人格健康测验（UPI）");
		CLASS_MAP.put("mss-ia","中学生网络成瘾测验");
		CLASS_MAP.put("mss-at","中小学生适应能力测验");
		CLASS_MAP.put( "cadhd16","儿童多动症医学诊断评定量表（16题）");
		CLASS_MAP.put( "cadhd14","儿童多动症诊断测验（14题）");
		CLASS_MAP.put( "prs","学习障碍儿童筛查量表");
		CLASS_MAP.put("ysrrs","青少年生活事件测验");
		CLASS_MAP.put( "tatq","考试焦虑测验");
		CLASS_MAP.put("srrs","生活事件量表");
		CLASS_MAP.put("difficultySleeping","入睡困难");
		CLASS_MAP.put("earlyAwakening","早醒");
		CLASS_MAP.put("halfwayAwakening","中途醒");
		CLASS_MAP.put("shallowSleeping","睡眠浅");
		CLASS_MAP.put("dreaminess","多梦");
		CLASS_MAP.put("daytimeSymptoms","日间不适");
		CLASS_MAP.put("gad7","焦虑症筛查量表(GAD7)");
		CLASS_MAP.put( "phq9","抑郁症筛查量表(PHQ9)");
		CLASS_MAP.put( "audioCure","专业音频治疗");
		CLASS_MAP.put( "menstruInsomnia","月经与失眠");
		CLASS_MAP.put( "deathOfFamily","亲人死亡引起的失眠问题");
		CLASS_MAP.put( "wakeUpNightMore","晚上起夜太多引起的失眠");
		CLASS_MAP.put( "quarrelDaytime","白天吵架了晚上睡不着了");
		CLASS_MAP.put( "timidInsomnia","关于胆怯性失眠");
		CLASS_MAP.put( "anxietyInsomnia","广泛焦虑性失眠");
		CLASS_MAP.put("figureSkatingDuoOneManDay","（白天听）花滑双人组1号男生");
		CLASS_MAP.put( "figureSkatingDuoOneManNight","（晚上听）花滑双人组1号男生");
		CLASS_MAP.put( "erMing","耳鸣");
		CLASS_MAP.put("headache","头痛");
		CLASS_MAP.put("sleepStop","睡眠呼吸暂停调节");
		CLASS_MAP.put("epworth","Epworth思睡量表");
	}
	
	
	
	public final static Map<String,String> CLASS_MAP_CLOSE = new HashMap<>();  
	static {
		CLASS_MAP_CLOSE.put( "sleepStop","睡眠呼吸暂停调节");
		CLASS_MAP_CLOSE.put( "epworth","Epworth思睡量表");
	}
	
	
	/**
	 * 直播公告
	 */
	public final static String liveDefaultNotice = "欢迎大家来到直播间，直播中严禁出现违规、低俗等内容，请大家共同遵守、监督。";
	
	/**
	 * 直播类型
	 */
	public final static String liveDefaultType = "AVChatRoom";
	
	
	/**
	 * 直播管理员账户
	 */
	public final static String liveAdmin = "administrator";
	
	/**
	 * 直播管理员账户
	 */
	public final static Integer maxGroupNumber = 1000;
	
	/**
	 * 普通音频路径
	 */
	public final static String normalAudioPath = "https://shuimian2.oss-cn-beijing.aliyuncs.com/audioAll/";
	
	/**
	 * 非普通音频路径
	 */
	public final static String audioPath = "https://shuimian2.oss-cn-beijing.aliyuncs.com/audioAll/";
	
	/**
	 * 合并音频后的路径
	 */
	public final static String combineAudioPath = "/var/www/media/audioCombine/";
	
	/**
	 * 合并音频后的播放路径
	 */
	//public final static String combineAudioUrl = "https://sleep.psychicspet.com/media/audioCombine/";
	
	/**
	 * 服务器音频路径
	 */
	public final static String audioServerPath = "/var/www/media/audioAll/";
	
	
	/**
	 * 课堂持续时长 单位分钟
	 */
	public final static Integer roomDuration = 45;
	
	/**
	 * 拖堂时长 单位分钟
	 */
	public final static Integer roomCloseDelay = 30;
	
	
	
	public final static Map<Integer,List<Integer>> FREE_MODEL_MAP = new HashMap<>();  
	static {
		//模式1 用于睡眠垫 免费使用的是：
		//	汪氏睡眠训练营 id:2  专业睡眠调节 id:619
		FREE_MODEL_MAP.put(0,Arrays.asList());  
		FREE_MODEL_MAP.put(1,Arrays.asList(2,619));  
		
		
		
//		FREE_MODEL_MAP.put("2",Arrays.asList(""));
	}
	
	public final static Map<Boolean,String> musicMap = new HashMap<>();  
	static {
		//汪氏放松减压功
		//musicMap.put(true,"https://shuimian2.oss-cn-beijing.aliyuncs.com/experienceaudio/relaxDecompress.mp3");  
		
		//汪氏催眠养生功
		musicMap.put(true,  "https://shuimian2.oss-cn-beijing.aliyuncs.com/experienceaudio/hypnosisHealth.mp3");
		//入睡困难
		musicMap.put(false,"https://shuimian2.oss-cn-beijing.aliyuncs.com/experienceaudio/hypnosisDifficultySleep.mp3");  
	}
	
	
}
